package com.lyj.dao.impl;

import org.springframework.stereotype.Repository;

import com.lyj.dao.UserDao;
import com.lyj.model.User;

/**
* 
* @author 李艺江
* @version 创建时间：2019年5月6日 下午11:13:25
*/

@Repository("userDao")
public class UserDaoImpl extends BaseDaoImpl<User> implements UserDao {

	@Override
	public User login(User user) {
		String hql = "from User u where u.id=:id and u.password=:password";
		return (User)getSession().createQuery(hql).setParameter("id", user.getId()).setParameter("password",user.getPassword()).uniqueResult();
	}


}
